Fix #14371: FP redundantAssignment for nested union members#8748
Fix #14371: FP redundantAssignment for nested union members#8748DanTheMan2000 wants to merge 2 commits into
Conversation
c50ae02 to
4761bef
Compare
|
There were actually two variants of this false positive. The one from the ticket involved reading another union member inside a larger expression. The other case is where an assignment to a different union member sits between the two writes to the member being reassigned. Added tests covering both in testother.cpp. |
4761bef to
d5f2fb4
Compare
|
Added a couple of control tests to go with the false-positive ones, wanted to make sure the fix is scoped to the actual variable being reassigned. |
|
Thanks for your contribution. |
The separate #14371 tests all used the same union definition, so combine them into one test case containing multiple functions as requested in review.
|
If you wish, you can add yourself to the AUTHORS file. Please add |
I don't think that's necessary. Thanks! |
No description provided.